from flask import Flask,Blueprint,make_response,jsonify,request

from flask import Flask,Blueprint,make_response,jsonify,request

class Message:
    def __init__(self,code = 200,data = {},msg='',status = 'ok'):
        self.code = code
        self.data = data
        self.msg = msg
        self.status = status
    def response(self):
        if self.code == 500:
            #日志写入 错误记录可以添加在这里
            pass
        return jsonify({"code":self.code,"data":self.data,"msg":self.msg,"status":self.status})
    def makeresponse(self):
        return make_response(jsonify({"code":self.code,"data":self.data,"msg":self.msg,"status":self.status}))
